
#ifdef WEB_FUN

#define   HTTP_SENDFLAG    1
#define   HTTP_SEND_PAGE   1        // help flag

#define   HTTP_GET         0
#define   HTTP_POST        1 
#define   HTTP_HEAD        2
						  
#define   HTTP_USERNAME    "super"
#define   HTTP_PASSWORD    "815"

#define	  _LOGIN_CGI       0
#define   _DEFAULT_CGI	   1
#define   _LEFT_CGI	       2
#define   _SYSTEM_CGI	   3
#define   _AI_CGI	       4
#define   _DI_CGI	       5
#define   _DO_CGI	       6
#define   _HISTORY_CGI     7
#define   _SYSCONF_CGI	   8
#define   _NET_CGI	       9
#define   _CHGPASSW_CGI   10  
#define   _INDEX_JPG	  11

#define   LOGIN_MAX_BUFF_SIZE   5
 

typedef struct http_file {        /* << HTTP File info >>                    */
   U8  Name[30];                  /* File Name                               */
   U8  *Start;                    /* File Start Address in ROM               */
   U32 Size;                      /* File Size in bytes                      */
} HTTP_FILE;

typedef struct sd_file {
   U8  Name[30];
   U32 Size;
} SD_FILE;


#ifdef FIRST
#define EXTERN 
EXTERN char *HTTP_Method_String[]={"GET", "POST", "HEAD"};
EXTERN const unsigned char *ContentType[]={ "text/html", "image/gif","text/javascript"};
EXTERN unsigned char const http_user[LOGIN_MAX_BUFF_SIZE];// = HTTP_USERNAME;
EXTERN char                http_passw[LOGIN_MAX_BUFF_SIZE]= HTTP_PASSWORD;

#else
#define EXTERN  extern 
EXTERN char *HTTP_Method_String[];
EXTERN const unsigned char *ContentType[];
EXTERN unsigned char const http_user[LOGIN_MAX_BUFF_SIZE];
EXTERN char                http_passw[LOGIN_MAX_BUFF_SIZE];

EXTERN unsigned short FileCnt;
EXTERN const struct http_file FileTab[];
#endif


EXTERN SD_FILE http_record[10];
EXTERN SD_FILE http_curve[10];
EXTERN char http_fn[32];
EXTERN unsigned char search_rnum,search_rnum1,search_cnum;
EXTERN int selyy,selmm;

EXTERN char http_msg[64];

EXTERN unsigned char  HTTPStatus;                       // status byte 
EXTERN unsigned int   HTTPBytesToSend;                  // bytes left to send
EXTERN unsigned short TCPTxDataCount;                   // nr. of bytes to send
EXTERN unsigned char  *PWebSide;                        // pointer to webside
EXTERN unsigned char  http_page,http_flag;
EXTERN unsigned int   WebOffSec;
EXTERN unsigned short ver_h,ver_l,ver_yy,ver_mn,ver_dd;
EXTERN char  ver_mks[12];


void init_web(short,unsigned char *,short);
void web_pro(void);

#endif
